package com.ponhu.ea2.goodsCenter.provider.biz;

import com.ponhu.ea2.dto.PhInventoryForCloudTradeDto;
import com.ponhu.ea2.entity.CloudTradeGoods;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Map;

/**
 * @author Wang
 * @date 2021/11/19 4:28 下午
 */
public interface CloudTradeCoreService {

    default PriceVO convertPrice(Map<String, BigDecimal> priceMap) {
        PriceVO priceVO = new PriceVO();
        priceVO.setWarehousingPrice(priceMap.get("WarehousingPrice"));
        priceVO.setSalesPriceGuidance(priceMap.get("SalesPriceGuidance"));
        priceVO.setSupplyPrice(priceMap.get("SupplyPrice"));
        return priceVO;
    }

    /**
     * 分发云商商品数据至其它业务系统（胖总管、WMS）
     * @param joinDto
     */
    public void dispatchDataToPonhuAndWMS(PhInventoryForCloudTradeDto joinDto);

    /**
     * 云商商品数据分发至商品中心
     * @param cloudTradeGoods
     */
    public PhInventoryForCloudTradeDto dispatchDataToGoodsCenter(CloudTradeGoods cloudTradeGoods);

    @Data
    @Accessors(chain = true)
    class PriceVO{
        /**
         * 入库价
         */
        private BigDecimal warehousingPrice;
        /**
         * 建议销售价
         */
        private BigDecimal salesPriceGuidance;
        /**
         * 供货价
         */
        private BigDecimal supplyPrice;
    }
}


